package cn.edu.zafu.bigdata.psy;

class InvalidScoreException extends Exception {
    public InvalidScoreException(String message) {
        super(message);
    }
}

class ScoreChecker {
    public static void checkScore(int score) throws InvalidScoreException {
        if (score < 0 || score > 100) {
            throw new InvalidScoreException("输入的分数无效，分数应在 0 到 100 之间。");
        } else {
            System.out.println("分数有效。");
        }
    }
}

class Main {
    public static void main(String[] args) {
        try {
            java.util.Scanner scanner = new java.util.Scanner(System.in);
            System.out.print("请输入分数：");
            int score = scanner.nextInt();
            ScoreChecker.checkScore(score);
        } catch (InvalidScoreException e) {
            System.out.println(e.getMessage());
        }
    }
}

